package com.sc.web.gwt.client.service;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.sc.web.gwt.shared.model.AgentAdmin;

import java.util.List;

@RemoteServiceRelativePath("AgentAdminDataManagementService")
public interface AgentAdminDataManagementService extends RemoteService {
    List<AgentAdmin> getAllAgentAdmins();
    List<AgentAdmin> searchAgentAdmins(String searchText, int selectedIndex);

    boolean saveOrUpdateAgentAdminData(AgentAdmin agentAdmin);


    AgentAdmin getAgentAdminInfo();

    /**
     * Utility/Convenience class.
     * Use AgentAdminDataManagementService.App.getInstance() to access static instance of AgentAdminDataManagementServiceAsync
     */
    public static class App {
        private static final AgentAdminDataManagementServiceAsync ourInstance = (AgentAdminDataManagementServiceAsync) GWT.create(AgentAdminDataManagementService.class);

        public static AgentAdminDataManagementServiceAsync getInstance() {
            return ourInstance;
        }
    }
}
